<%@ page language="java"  pageEncoding="UTF-8" contentType="text/html;charset=utf-8"%>

<%@ include file="/_taglib.jsp" %>
<%@ include file="/_navbar.jsp" %>
<section class="content" id="sys_user_edit">
			<form class="required-validate" id="form_sys_user_edit" role="form" method="post">

				<input type="hidden" "user__id" name="user.id" value="${user.id}">
				<!-- general form elements disabled -->
				<div class="box">
					<div class="box-body">

						<div class="row">
							<div class="col-xs-3">
								<!-- text input -->
								<div class="form-group">
									<label>登录名</label> 
									<input type="text" class="form-control {required:true, minlength:2}"
										id="user__loginName"
										name="user.loginName" 
										value="${user.loginName}"
										placeholder="Enter ...">
								</div>
							</div>
							<div class="col-xs-3">
								<!-- text input -->
								<div class="form-group">
									<label>姓名</label> 
									<input type="text" class="form-control {required:true, minlength:2}"
										id="user__realName"
										name="user.realName"
										value="${user.realName}"
										placeholder="Enter ...">
								</div>
							</div>
							<div class="col-xs-3">
								<!-- text input -->
								<div class="form-group">
									<label>邮箱</label> 
									<input type="text" class="form-control email"
										id="user__email"
										name="user.email"
										value="${user.email}"
										placeholder="Enter ...">
								</div>
							</div>
							<div class="col-xs-3">
								<!-- text input -->
								<div class="form-group">
									<label>手机</label> 
									<input type="text" class="form-control mobile"
										id="user__mobile"
										name="user.mobile"
										value="${user.mobile}"
										placeholder="Enter ...">
								</div>
							</div>
							<div class="col-xs-3">
								<div class="form-group">
									<label>数据状态</label> 
									<j:select dictType="dataStatus" id="user__status" name="user.status" label="数据状态"/>
								</div>
							</div>	
                            <div class="col-xs-3">
								<div class="form-group">
									<label>用户分组</label>                             	
	                            	<div class="input-group">
		                             	<input type="hidden" id="user__orgId" name="user.orgId" value="${user.orgId}">
		                             	<input type="text" id="user__orgName" class="form-control" value="${user.orgName}" readonly>
		                             	<span class="input-group-addon" onclick="showMenu_sys_user_edit(this); return false;"><i class="fa fa-ellipsis-v"></i></span>
									</div>
								</div>
								<div id="menuContent" class="jfk-ztree-menu-content">
									<ul id="orgListTree" class="ztree"></ul>
								</div>
                            </div>	
							<div class="col-xs-3">
								<!-- text input -->
								<div class="form-group">
									<label>身份证号码</label> 
									<input type="text" class="form-control"
										id="user__idCard"
										name="user.idCard"
										value="${user.idCard}"
										placeholder="Enter ...">
								</div>
							</div>	
						</div>
						<div class="row">
							<div class="col-xs-6">
								<!-- text input -->
								<div class="form-group">
									<label>籍贯</label> 
									<input id="temp_nativePlace" autocomplete="off" type="text" placeholder="请选择所在区域" 
									class="form-control inputFocus proCityQueryAll proCitySelAll add-form-input"
									value="<j:kv key="${user.nativePlace}" column="namePath" table="jfk_region"/>">
									<input type="hidden" id="user__nativePlace" name="user.nativePlace" value="${user.nativePlace}">
								</div>
							</div>
							<div class="col-xs-6">
								<!-- text input -->
								<div class="form-group">
									<label>工作城市</label> 
									<input id="temp_workPlace" autocomplete="off" type="text" placeholder="请选择所在区域" 
									class="form-control inputFocus proCityQueryAll proCitySelAll add-form-input"
									value="<j:kv key="${user.workPlace}" column="namePath" table="jfk_region"/>">
									<input type="hidden" id="user__workPlace" name="user.workPlace" value="${user.workPlace}">
								</div>
							</div>													
						</div>
						<div class="row">
							<div class="col-xs-12">
								<!-- text input -->
								<div class="form-group">
									<label>备注</label> 
									<textarea class="form-control" rows="3" 
										id="user__remark"
										name="user.remark"
										placeholder="Enter ...">${user.remark}</textarea>
								</div>
							</div>
						</div>
				
						
						<div class="row">
							<div class="col-xs-12">						

								<div class="form-group jfk-center-1">
									<label>头像</label>
                                    <input type="hidden" id="picture" name="user.picture" value="${user.picture}">
									<c:choose>
										<c:when test="${empty user.picture}">
											<img id="imgUrl_user_picture" src="http://placehold.it/350x300" alt="..." class="margin jfk-center-1" height="100">
										</c:when>
										<c:otherwise>
											<a id="hrefUrl_user_picture" href="<j:kv key="${user.picture}" column="file_path" table="jfk_attachment_file"/>" target="_bank">
											<img id="imgUrl_user_picture" src="<j:kv key="${user.picture}" column="file_path" table="jfk_attachment_file"/>" alt="..." class="margin jfk-center-1" height="100">
											</a>
										</c:otherwise>
									</c:choose>
									<div>
										<a href="#" style="float:left" data-toggle="modal" data-target="#upload-compose-modal" onclick="selectFile('jfk_user','${user.id}','uploadpic','imgUrl_user_picture','picture',null);">上传</a>
										<a href="#" style="float:right" onclick="clearFile('jfk_user','${user.id}','uploadpic','imgUrl_user_picture','picture','hrefUrl_user_picture',null)">清除</a>
									</div>
								</div>		

		
							</div>
						</div>

					</div>					<!-- /.box-body -->
					<div class="box-footer" align="center">
						<button type="button" class="btn btn-primary" onClick="save();"
							style="postion: absolute; left: 45%;">保存</button>
						<button type="button" class="btn btn-primary"
							style="postion: absolute; left: 45%;" onClick="initPassword('${user.id}');">密码初始化</button>
					</div>
				</div>				<!-- /.box -->
			</form>
</section>


<%  
//    String path = request.getContextPath();  
//    String basePath = request.getScheme() + "://"  
//            + request.getServerName() + ":" + request.getServerPort()  
//            + path + "/";  
%> 

<%@ include file="/_edit_js.jsp" %>
<script type="text/javascript">
	
	//实现jsp与js文件分离，但目前涉及到jstl标签的暂时没有分离，以后避免js中使用jstl标签

	var backUrl_sys_user_edit = '${backUrl}';
	var zNodes_sys_user_edit = ${orgList};
	

</script>
<script type="text/javascript" src="sys/user/edit.js" ></script>

